import java.util.Scanner;
public class LoginSimulation {
    public static void main(String[] args) {
        int passward = 1244;
        int time = 0;
        int i = 3;
        int flg = 0;
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入密码");
        for(time = 1;time <=3;time++){
            int ret = scanner.nextInt();
            if (ret == passward){
                System.out.println("输入正确");
                flg = 1;
                break;
            }else {
                System.out.println("输入错误");
                i--;
                System.out.println("你还有"+i+"次机会");
            }
        }
        if(flg == 0){
            System.out.println("三次次数已经用完，退出系统");
        }
    }
}
